package com.efuture.chaptersix

/* @Description:Kotlin语言的可空类型扩展函数
 * @Auther: zhaoshanshan
 * @Date: 2022/03/11/6:17 下午
 */
//定义可空函数
fun String?.stringFunVale(defaultValue:String)= this ?: defaultValue
fun main() {
   val name :String?=null
    println(name.stringFunVale("zhaoshanzhan"))
    val age = "30"
    println(age.stringFunVale("31"))
}

    